package com.shyroke.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.shyroke.entity.Email;

public interface EmailMapper {
	int deleteByPrimaryKey(Integer id);

	int insert(Email record);

	int insertSelective(Email record);

	Email selectByPrimaryKey(Integer id);

	int updateByPrimaryKeySelective(Email record);

	int updateByPrimaryKey(Email record);

	/**
	 * 获取所有邮件
	 * 
	 * @param userId
	 * @return
	 */
	List<Email> selectAll(@Param("userId") Integer userId);

	/**
	 * 根据用户ID分页查询所有邮件
	 * 
	 * @param userId
	 * @param beginIndex
	 * @param endIndex
	 * @return
	 */
	List<Email> selectAllByPage(@Param("userId")Integer userId, @Param("beginIndex")int beginIndex, @Param("endIndex")int endIndex);

	/**
	 * 根据用户ID，接受用户ID和邮件类型获取邮件
	 * @param sendUserID
	 * @param receiveUserID
	 * @param string
	 * @return
	 */
	Email isSend(@Param("sendUserID")Integer sendUserID, @Param("receiveUserID")Integer receiveUserID, @Param("type")String type);
}